﻿@model cloudscribe.Core.IdentityServerIntegration.Models.IdentityItemViewModel
@using cloudscribe.Core.IdentityServerIntegration
@inject IStringLocalizer<CloudscribeIds4Resources> sr
<form asp-controller="IdentityResource" asp-action="EditResource">
    <input asp-for="SiteId" type="hidden" />
    <input asp-for="Name" type="hidden" />  
    <div class="form-horizontal">
        @*<div asp-validation-summary="All" class="text-danger"></div>*@
        <div class="form-group">
            <label>@sr["Name"]</label>
            <label class="form-control">@Model.Name</label>
        </div>
        <div class="form-group">
            <label asp-for="DisplayName">@sr["Display Name"]</label>
            <input class="form-control" asp-for="DisplayName" />
            <span asp-validation-for="DisplayName" class="invalid-feedback"></span> 
            @Html.ValidationMessage("apierror", new { @class = "text-danger" })
        </div>
        <div class="form-group">
            <label asp-for="Description">@sr["Description"]</label>
            <input class="form-control" asp-for="Description" />
            <span asp-validation-for="Description" class="invalid-feedback"></span> 
        </div>
        <div class="form-group">
            <div class="form-check">
                <input asp-for="Enabled" class="form-check-input" />
                <label asp-for="Enabled" class="form-check-label">@sr["Enabled"]</label>
            </div>
        </div>
        <div class="form-group">
            <div class="form-check">
                <input asp-for="Required" class="form-check-input" />
                <label asp-for="Required" class="form-check-label">@sr["Required"]</label>
            </div>
        </div>
        <div class="form-group">
            <div class="form-check">
                <input asp-for="ShowInDiscoveryDocument" class="form-check-input" />
                <label asp-for="ShowInDiscoveryDocument" class="form-check-label">@sr["Show In Discovery Document"]</label>
            </div>
        </div>
        <div class="form-group">
            <button name="submit" type="submit" class="btn btn-primary">@sr["Save"]</button>
            <a class="btn btn-primary" asp-action="Index" asp-controller="IdentityResource"
                    asp-route-siteId="@Model.SiteId">@sr["Cancel"]</a>
        </div>
    </div>
</form>
